package com.springboot.service.impl;

import com.springboot.mapper.OrderFormMapper;
import com.springboot.mapper.PatientInfoFormMapper;
import com.springboot.model.OrderForm;
import com.springboot.model.PatientInfoForm;
import com.springboot.service.AssistantSeePatientListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;


@Service
public class AssistantSeePatientListServiceImpl implements AssistantSeePatientListService {
    @Autowired
    private OrderFormMapper orderFormMapper;
    @Autowired
    private PatientInfoFormMapper patientInfoFormMapper;

    @Override
    public ArrayList<OrderForm> getRecentlyOrderListByDoctorTel(Integer doctorId){
        ArrayList<OrderForm> orderForms=new ArrayList<>();
        try{
            orderForms=orderFormMapper.selectByDoctorId(doctorId);
        }
        catch (Exception e){
            System.out.println("orderFormMapper错误");
            e.printStackTrace();
        }
        return orderForms;
    }

    @Override
    public PatientInfoForm getPatientInfoFormByBootId(Integer bootId){
        PatientInfoForm patientInfoForm=new PatientInfoForm();
        try{
            patientInfoForm=patientInfoFormMapper.selectByPrimaryKey(bootId);
        }
        catch (Exception e){
            System.out.println("orderFormMapper错误");
            e.printStackTrace();
        }
        return patientInfoForm;
    }
}
